package game;


public abstract class Company {

    protected int size;
	protected boolean onboard;
	protected String name;
	protected int remainingStocks;
	protected int companyIndex;
	
	public Company(enumCompany name){
		this.name = name.toString();
		size = 0;
		onboard = false;
		remainingStocks = 25;
		companyIndex = name.getIndex();
	}
	
	abstract public int getStockValue();
	
	public boolean isSafe(){
		return (size>10);
	}
	
	public int getCompanyIndex()
	{
		return companyIndex;
	}
	
	public int getSize(){
		return size;
	}
	
	public void setCompanyOnBoard()
	{
		onboard = true;
	}
	
	public boolean isOnBoard(){
		return onboard;
	}
	
	
	public void increaseSize(int size) {
		this.size += size;
	}

	public void removeFromBoard() {
		size = 0;
		onboard = false;
	}

	public void addToBoard(){
		onboard=true;
	}
	
	public int getFirstPrizeValue() {
		return (getStockValue() * 10);
	}

	public int getSecondPrizeValue() {
		return (getStockValue() * 5);
	}
	
	public String toString() { 
		return name;
	};
	
	public int remainingStocksInBank() { 
		return remainingStocks;
	}
	
	public void increaseStocksInBank(int amount) {
		remainingStocks += amount;
	}
	
	public void decreaseStocksInBank(int amount) {
		remainingStocks -= amount;
	}
}
